package com.jzo2o.customer.controller.agency;


import com.jzo2o.customer.model.dto.request.InstitutionResetPasswordReqDTO;
import com.jzo2o.customer.model.dto.response.ServeProviderInfoResDTO;
import com.jzo2o.customer.service.IServeProviderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 机构端 - 服务人员或机构相关接口
 */
@RestController("agencyServeProviderController")
@RequestMapping("/agency/serve-provider")
@Api(tags = "机构端 - 服务人员或机构相关接口")
public class ServeProviderController {
    @Resource
    private IServeProviderService serveProviderService;

    /**
     * 获取当前登录的服务提供者（机构或服务人员）信息
     * @return 包含当前用户信息的响应DTO
     */
    @GetMapping("/currentUserInfo")
    @ApiOperation("获取当前用户信息")
    public ServeProviderInfoResDTO currentUserInfo() {
        return serveProviderService.currentUserInfo();
    }

    /**
     * 机构忘记密码时的密码重置接口，接收重置密码所需参数并处理
     * @param institutionResetPasswordReqDTO 机构密码重置请求DTO，包含验证及新密码信息
     */
    @PostMapping("/institution/resetPassword")
    @ApiOperation("机构忘记密码功能")
    public void resetPassword(@RequestBody InstitutionResetPasswordReqDTO institutionResetPasswordReqDTO) {
        serveProviderService.institutionResetPassword(institutionResetPasswordReqDTO);
    }
}
